﻿@using Emoney.UserTraining.Model;
@using Emoney.UserTraining.Comm;
@{
    Layout = null;
}
@{
    var uname = ViewData["uname"].ToString();
    var lst = (List<Traning_NetworkMeeting>)ViewData["lst"];
    }
<div class="tablestyle t1">
<div class="topheader">
<div class="tableitem" style="color:black;">
	<div class="time">培训时间</div>
	<div class="theme1">主题</div>
	<div class="style">类型</div>
	<div class="name1">讲师</div>
	<div class="qq">QQ提醒</div>
	<div class="status">状态</div>
</div>
</div>
@{
int count = 1;
var strclass = "";
foreach(var c in lst)
{
    if (count % 2 == 0)
    {
        strclass = "tableitem bg1 tt6";
    }
    else
    {
        strclass = "tableitem tt6";
    }
    string usertype = c.meeting_type;
    if (usertype.Length > 4)
    {
        usertype = usertype.Substring(0, 4);
    }
    string mtgname = StringTools.SubStr(c.mtg_name, 11);
    <div class="@strclass">
		<div class="time2"><b>@string.Format("{0:M/d}", c.class_date) @string.Format("{0:t}", c.class_date)-@string.Format("{0:t}", c.endDate)</b></div>
		<div class="theme1" title="@c.mtg_name">@mtgname</div>
		<div class="style">@usertype</div>
		<div class="name1" title="@c.txtreateachar">@c.txtteachar</div>
		<div class="qq">
            @{
                if(c.class_date>DateTime.Now)
                {
                    <a href="javascript:" onclick="QQTipFun('@mtgname', '@c.class_date', '@c.mtg_id', '@uname','@c.Id')" id="qqtips" class="b" >设置</a>
                }
                else
                {
                    <span>设置</span>
                }
                }
		</div>
		<div class="opertion1">
            @{
            string rel = StringTools.getTimeIsOpen(c.before_time, c.class_date.ToString(), c.endDate.ToString(), c.Duration_date, c.mtg_id);
            if (rel == "0")//正在进行
            { 
                        <a href="javascript:OpenNetMeeting('@c.mtg_id','@uname','@c.Id')"><img src="@StringTools.GetStaticFile("Images/Train/images/btn12.jpg")" height="22" width="71" state="true"/></a>
            }
            else if (rel == "-1")//会议已结束
            {
                if (!string.IsNullOrEmpty(c.video_url))
                {
                        <a href="@c.video_url" target="_blank" onclick="AddClickCount('videoTip','课程回放','@c.Id')"><img src="@StringTools.GetStaticFile("Images/Train/images/btn13.jpg")" height="22" width="71" state="true"/></a>
                }
            }
            else if (rel == "")//
            {

            }
            else
            {
                if(Emoney.UserTraining.Web.Traincom.GetOrderLst(c.Id.ToString(),uname)>0)
                {
                    <img src="@StringTools.GetStaticFile("Images/Train/images/btn17.jpg")" state="true"/>
                }
                else
                {
                    <a href="#" onclick="OrderNetInfo('@c.Id','@c.mtg_name','@c.before_time','@c.mtg_id','@uname','@c.class_date')"><img src="@StringTools.GetStaticFile("Images/Train/images/btn14.jpg")" height="22" width="71" state="true"/></a>
                }
            }
                    }
		</div>
	</div>
            count++;
}
}
</div>
@Html.Raw((string)ViewData["strPage"])
<script>
    function setImgUrl(imgString, rStr) {
        var Result = new Array(4)
        , imgUrl = imgString;
        Result[0] = imgUrl.replace(/((.*)\/)(.*)(\.[a-zA-z]{3,5})$/, '$1');
        Result[1] = imgUrl.replace(/((.*)\/)(.*)(\.[a-zA-z]{3,5})$/, '$3');
        Result[2] = Result[1].replace(/((_over)|(_click))/, "");
        Result[3] = imgUrl.replace(/((.*)\/)(.*)(\.[a-zA-z]{3,4})$/, '$4');
        return Result[0] + Result[2] + rStr + Result[3];
    }

    $("[state=true]").mouseenter(function () {
        $(this).attr("src", setImgUrl($(this).attr("src"), "_over"));
    }).mouseleave(function () {
        $(this).attr("src", setImgUrl($(this).attr("src"), ""));
    }).mousedown(function (e) {
        $(this).attr("src", setImgUrl($(this).attr("src"), "_click"));
    }).mouseup(function (e) {
        $(this).attr("src", setImgUrl($(this).attr("src"), "_over"));
    });
</script>
